<template>
  <div class="admin">
    <el-table
        :data="tableData"
        border
        style="width: 100%"
        @selection-change="handleSelectionChange">
      <el-table-column
          type="selection"
          width="55">
      </el-table-column>
      <el-table-column
          prop="ID"
          label="ID"
          sortable
          width="180">
      </el-table-column>
      <el-table-column
          prop="username"
          label="用户名"
          sortable
          width="180">
      </el-table-column>
      <el-table-column
          prop="rule"
          label="拥有权限规则">
      </el-table-column>
      <el-table-column
          prop="desc"
          label="描述">
      </el-table-column>
      <el-table-column
          label="状态">
        <el-button v-show="!status" type="success" icon="el-icon-check" circle></el-button>
        <el-button v-show="status" type="danger" icon="el-icon-delete" circle></el-button>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
              size="mini"
              @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
          <el-button
              size="mini"
              type="danger"
              @click="handleDelete(scope.$index, scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
        background
        layout="prev, pager, next"
        :total="50">
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: "Role",
  data() {
    return {
      tableData: [
        {
          ID: '1',
          username: 'admin',
          role: '18925139194',
          desc: '18925139194@163.com'
        },
        {
          ID: '1',
          username: 'admin',
          role: '18925139194',
          desc: '18925139194@163.com'
        },
        {
          ID: '1',
          username: 'admin',
          role: '18925139194',
          desc: '18925139194@163.com'
        },
        {
          ID: '1',
          username: 'admin',
          role: '18925139194',
          desc: '18925139194@163.com'
        },
        {
          ID: '1',
          username: 'admin',
          role: '18925139194',
          desc: '18925139194@163.com'
        }
      ],
      status: false
    }
  }
}
</script>

<style scoped>
  .el-pagination{
    margin-top: 10px;
    text-align: center;
  }
</style>